/*
 * @Author: taoshiwei
 * @Date: 2019-04-09 14:39:32
 * @Last Modified by: taoshiwei
 * @Last Modified time: 2019-04-29 14:53:23
 *
 * 学科
 */

import { createAPI } from '@/utils/request'

// 学科列表
export const list = data => createAPI('/subjects', 'get', data)

// 学科简单列表
export const simple = data => createAPI('/subjects/simple', 'get', data)

// 学科详情
export const updateSubRequest = data => createAPI(`/subjects/${data.id}`, 'get', data)

// 学科添加
export const add = data => createAPI('/subjects', 'post', data)

// 学科修改
export const update = data => createAPI(`/subjects/${data.id}`, 'put', data)

// 学科删除
export const remove = data => createAPI(`/subjects/${data.id}`, 'delete', data)
// 获取二级目录
export const getTwoliequeststRequest = id => createAPI(`/directorys/simple?subjectID?${id}`, 'get')
// 获取标签列表
export const getTagslistRequest = id => createAPI(`/tags/simple?subjectID?${id}`, 'get')
// 获取录入人
export const getUsersListRequest = data => createAPI('/users/simple', 'get')
// 获取基础题库 /questions
export const getQuestionsListRequest = params => createAPI('/questions', 'get', params)

// 获取详情信息

export const getDetailRequest = id => createAPI(`/questions/${id}`, 'get')
// 获取所有企业列表
export const getCompanysListRequest = params => createAPI('/companys', 'get', params)
// 新增基础题库

export const addQuestionRequest = data => createAPI('/questions', 'POST', data)

// 获取详情

export const getEditDetailRequest = (id) => createAPI(`/questions/${id}`, 'get')

// 更新

export const updataQuestionRequest = (data, id) => createAPI(`/questions/${id}`, 'put', data)
// 添加接口
export const addListRequest = data => createAPI('/subjects', 'post', data)
// 学科列表
export const subjectsListRequest = data => createAPI('/subjects', 'get', data)
// 学科删除
export const delRemoveRequest = data => createAPI(`/subjects/${data.id}`, 'delete', data)
